
#iChannel0"file://lv_1.png"

vec2 center=vec2(.5,.5);
float speed=.135;

float start=1.;
float end=3.;

vec2 lastPoint = vec2(0.0);
// float lastTime = 0.0;
void mainImage(out vec4 fragColor,in vec2 fragCoord)
{
    vec2 tapPoint=vec2(iMouse.x/iResolution.x,iMouse.y/iResolution.y);
    center=tapPoint;

    float time = iTime;
    if(lastPoint != tapPoint){
        time = 0.0;
    }
    
    vec2 uv=fragCoord.xy/iResolution.xy;

    if(tapPoint.x>.5){
        float invAr=iResolution.y/iResolution.x;
        
        vec3 col=vec4(uv,.5+.5*sin(time),1.).xyz;
        
        vec3 texcol;
        
        float x=(center.x-uv.x);
        float y=(center.y-uv.y)*invAr;
        
        float r=-sqrt(x*x+y*y);//uncoment this line to symmetric ripples
        //float r = -(x*x + y*y);
        
        float rad=(r+time*speed)/.013;
        float z=1.+.5*sin(rad);
        
        if(time>3.14*2./rad){
            z=1.;
        }
        
        texcol.x=z;
        texcol.y=z;
        texcol.z=z;
        
        vec4 color1=texture(iChannel0,uv);
        vec3 addedColor=col*texcol*.1;
        fragColor=vec4(addedColor+color1.rgb,1.);
    }else{
        vec4 color1=texture(iChannel0,uv);
        fragColor=vec4(color1.rgb,1.);
    }
    
}
